package com.szx.kaihei.validators;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented
@Constraint(validatedBy = NInNValidator.class)
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidNInN {
    String message() default "必须有1个有值";

    //如果不填字段，则默认为所有字段
    String[] fields();

    //默认必须有几个有值，如果有值字段数大于已选字段数则默认为1
    int number() default 1;
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
